package com.yfp.client.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yfp.client.domain.OrderDetail;
import com.yfp.client.mapper.OrderDetailMapper;
import com.yfp.client.service.OrderDetailService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author admin
 * @description 针对表【order_detail】的数据库操作Service实现
 * @createDate 2024-05-24 10:39:52
 */
@Service
public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailMapper, OrderDetail> implements OrderDetailService {

    @Resource
    private OrderDetailMapper orderDetailMapper;

    /**
     * 根据订单id查询订单详情
     *
     * @param orderId
     * @return
     */
    @Override
    public List<OrderDetail> listByOrderId(String orderId) {
        return orderDetailMapper.listByOrderId(orderId);
    }

    /**
     * 根据订单详情id查询订单详情
     *
     * @param orderDetailId
     * @return
     */
    @Override
    public OrderDetail listByOrderDetailId(String orderDetailId) {
        return baseMapper.selectById(orderDetailId);
    }

    /**
     * 根据套餐id查询订单详情
     *
     * @param packageId
     * @return
     */
    @Override
    public List<OrderDetail> listByPackageId(String packageId) {
        return orderDetailMapper.listByPackageId(packageId);
    }

    /**
     * 根据订单详情id集合查询订单详情
     *
     * @param orderDetailId
     * @return
     */
    @Override
    public List<OrderDetail> listByOrderDetailIds(List<String> orderDetailId) {
        return orderDetailMapper.listByOrderDetailIds(orderDetailId);
    }

    /**
     * 设置排队时间
     * @param orderId
     */
    @Override
    public void setQueueTime(String orderId) {
        orderDetailMapper.setQueueTime(orderId);
    }
}




